<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>密码找回</title>
<link rel="stylesheet" type="text/css" href="../../css/reset.css" />
<link rel="stylesheet" type="text/css" href="../../css/css.css" />
<link rel="stylesheet" type="text/css"
	href="../../js/jquery-easyui-1.4.3/themes/default/easyui.css" />
<link rel="stylesheet" type="text/css"
	href="../../js/jquery-easyui-1.4.3/themes/icon.css" />
<link rel="stylesheet" type="text/css"
	href="../../js/SimpleTree1.3/js/tree_themes/SimpleTree.css" />
<link rel="stylesheet" type="text/css" href="../../css/colorReset.css" />
<style>
html, body {
	width: 100%;
	height: 100%;
	font-size: 16px;
}

body {
	background: url(../../images/regist_bg.jpg) center bottom no-repeat;
}

.textbox {
	-webkit-border-radius: 0;
	border-radius: 0;
}

.combo {
	border-color: #d3d7da;
}

.title {
	width: 80%;
	margin: 0 auto;
	padding: 10px 0 10px 0;
	font-size: 25px;
	text-align: center;
}

.title h2 img {
	width: 176px;
}

.main {
	position: relative;
	width: 410px;
	height: 290px;
	margin: 20px auto 0;
	border: none;
	padding: 0;
	border-radius: 4px;
	background: #fff;
}

.regist_con_tit {
	width: 100%;
	height: 40px;
	line-height: 40px;
	text-align: center;
	vertical-align: middle;
	/*background: #30badf;*/
	background: url(../../images/tree_header.png) left top repeat-x;
	color: #fff;
	border-radius: 5px 5px 0 0;
}

.regist_con {
	width: 410px;
	margin: 0 auto;
}

.regist_con h3 {
	text-align: center;
	font-size: 14px;
	font-weight: bold;
	background: rgb(210, 224, 242);
	padding: 5px;
}

.regist_con ul {
	margin: 10px auto;
	width: 100%;
	overflow: hidden;
}

.regist_con ul li {
	display: block;
	float: left;
	height: 25px;
	overflow: hidden;
	padding: 5px 0;
}

.regist_con ul li.li_col {
	width: 100%;
	height: auto;
}

.regist_con .text {
	width: 270px;
	border: 1px solid #d3d7da;
	padding: 2px 3px;
	border-radius: 0;
	height: 20px;
	line-height: 20px;
	vertical-align: middle;
}

.regist_con .label {
	width: 90px;
	text-align: right;
	display: block;
	float: left;
	line-height: 25px;
}

.regist_con .input_con {
	float: left;
	margin-left: 10px;
}

.regist_con .input_con .input_con_li {
	padding: 5px 0;
}

.btn-con {
	margin-top: 20px;
}

.ensure_btn {
	float: left;
	margin-left: 100px;
}

.cancel_btn {
	float: right;
	margin-right: 32px;
}

.retr-tips {
	padding: 10px;
	line-height: 20px;
	text-align: center;
}
</style>
</head>

<body>
	<div class="title">
		<h2>
			<img src="../../images/logo.png" alt="" />
		</h2>
	</div>
	<div class="main">
		<div class="border_con top-border">
			<div class="corner_con left-top-corner"></div>
			<div class="corner_con right-top-corner"></div>
		</div>
		<div class="border_con left-border"></div>
		<div class="main-con">
			<div class="regist_con_tit">密码找回</div>
			<p class="retr-tips">请填写需要找回密码的账号资料，申诉成功后系统会自动将新密码发送到你的邮箱，请耐心等待！</p>
			<div class="regist_con">
				<form id="retrieveForm" method="post">
					<ul>
						<li class="li_col"><label for="userCode" class="label">申诉账号</label>
							<div class="input_con">
								<input id="userCode" name="userCode" type="text"
									class="easyui-validatebox text" data-options="required:true"
									missingMessage="账号不能为空！" />
							</div></li>
						<li class="li_col"><label for="userName" class="label">姓名</label>
							<div class="input_con">
								<input id="userName" name="userName" type="text"
									class="easyui-validatebox text" data-options="required:true"
									missingMessage="姓名不能为空！" />
							</div></li>
						<li class="li_col"><label for="empNo" class="label">工号</label>
							<div class="input_con">
								<input id="empNo" name="empNo" type="text"
									class="easyui-validatebox text" data-options="required:true"
									missingMessage="工号不能为空！" />
							</div></li>
						<li class="li_col"><label for="emailAddress" class="label">邮箱地址</label>
							<div class="input_con">
								<input id="emailAddress" name="emailAddress" type="text"
									class="easyui-validatebox text" title="请输入注册时所填的邮箱地址"
									data-options="required:true,validType:'email'"
									missingMessage="邮箱地址不能为空！"
									invalidMessage="请输入有效的电子邮件地址，如example@szlanyou.com" />
							</div></li>
						<li class="li_col btn-con">
							<button class="ensure_btn default_btn" id="confirm">确认</button>
							<button class="cancel_btn default_btn" id="cancel-btn">取消</button>
						</li>
					</ul>
				</form>
			</div>
		</div>
		<div class="border_con right-border"></div>
		<div class="border_con bottom-border">
			<div class="corner_con left-bottom-corner"></div>
			<div class="corner_con right-bottom-corner"></div>
		</div>
	</div>



	<script type="text/javascript" src="/webjars/json3/3.3.2/json3.min.js"></script>
	<script type="text/javascript"
		src="../../js/jquery-easyui-1.4.3/jquery.min.js"></script>
	<script type="text/javascript"
		src="../../js/jquery-easyui-1.4.3/jquery.easyui.min.js"></script>
	<script type="text/javascript"
		src="../../js/jquery-easyui-1.4.3/locale/easyui-lang-zh_CN.js"></script>

	<script type="text/javascript" src="../../js/cook/constants.js"></script>
	<script type="text/javascript" src="../../js/cook/FormValidate.js"></script>
	<script type="text/javascript" src="../../js/cook/public.js"></script>
	<script>
$(document).ready(function(){		 
	$("#userCode").focus();

	$(".easyui-validatebox").blur(function() {
		$(this).validatebox("validate");
	});

});
$("#confirm").click(function(e) {
	e.preventDefault();
    if($("#retrieveForm").form("validate")){
    	$("#confirm").attr("disabled", "disabled").text("提交中...");
    	var userInfoJSON = $("#retrieveForm").serializeJson();
    	$.ajax({
    		type: "post",
    		url: BASE_URL_USER_SEARCH + "/findBackPassword",
    		data: JSON.stringify(userInfoJSON),
    		contentType: "application/json",
    		success: function(result) {
    			$("#confirm").removeAttr("disabled").text("确定");
    			if(result.backValue === true)
    			{
    				$.messager.alert('提示','<p>密码找回成功，新密码已发送至您提供的邮箱地址，请尽快登录邮箱查收!</p>','info',function(){
    					window.location.href = "UserLogin.html";
    				});
    			}
    			else
    			{
    				$.messager.alert('错误','<p>密码找回失败！' + result.backValue + '</p>','error');
    			}
    		},
    		error: function() {
    			$("#confirm").removeAttr("disabled").text("确定");
    			$.messager.alert('错误','<p>服务异常，密码找回失败，请稍后重试!</p>','error');
    		}
    	});
	}
});
$("#cancel-btn").click(function(e) {
	e.preventDefault();
	window.location.href = "/UserLogin.html";
});

	
</script>
</body>
</html>
